package com.lagou.edu.controller;

import com.lagou.edu.service.EmailService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author grung
 * @Date 2020/10/25 10:00
 * @Version 1.0
 */

@RestController
@RequestMapping("/email")
public class EmailController {

    @Reference
    private EmailService emailService;

    @GetMapping("/{email}/{code}")
    public Boolean sendEmail(@PathVariable String email,@PathVariable String code){
        return emailService.sendEmail(email,code);
    }

}
